package models

import (
	"gorm.io/gorm"
	"time"
)

type Video struct {
	ID            int64     `gorm:"primaryKey;autoIncrement;comment:主键"`
	UserID        int64     `gorm:"not null;default:0;index:fk_user_video;comment:user表主键"`
	Title         string    `gorm:"type:varchar(128);not null;default:'';comment:视频标题"`
	PlayURL       string    `gorm:"type:varchar(128);not null;default:'';comment:视频地址"`
	CoverURL      string    `gorm:"type:varchar(128);not null;default:'';comment:封面地址"`
	FavoriteCount int64     `gorm:"not null;default:0;comment:获赞数量"`
	CommentCount  int64     `gorm:"not null;default:0;comment:评论数量"`
	CreatedAt     time.Time `gorm:"comment:创建时间"`
	UpdatedAt     time.Time `gorm:"autoUpdateTime;comment:更新时间"`
	DeletedAt     gorm.DeletedAt
}

func (Video) TableName() string {
	return "video"
}
